<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>

<label id="label1">文本框：
    <input type="text" name="textfield" id="textfield" />
</label>
<script>
var label = document.getElementById("label1");
label.className="class1";
label.htmlFor="textfield";
</script>





</body>
</html>
